<template>
  <div
    class="nav-bar-item"
  >
    <router-link :to="path" v-if="path" >
      {{title}}
    </router-link>
    <div class="title">
      <div class="tri"></div>
      {{ title }}
    </div>
  </div>
</template>

<script>
export default {
  props: ["title", "path"],
};
</script>

<style scoped>
.nav-bar-item {
  position: relative;
  color: #fff;
  width: 100%;
  height: 56px;
  line-height: 56px;
  font-size: 24px;
  text-align: center;
  box-sizing: border-box;
}
.title {
  display: none;
  position: absolute;
  top: 13px;
  left: 76px;
  width: 50px;
  height: 30px;
  line-height: 30px;
  background-color: rgba(0, 0, 0, 0.8);
  border-radius: 4px;
  z-index: 1000;
  text-align: center;
  font-size: 14px;
}
.tri {
  position: absolute;
  right: 50px;
  top: 5px;
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-right: 10px solid rgba(0, 0, 0, 0.8);
  border-bottom: 10px solid transparent;
  border-left: 10px solid transparent;
}
.active{
  border-left: 4px solid #006eff;
}
.nav-bar-item a{
  color:  #fff;
  text-decoration:none
}
.nav-bar-item:hover .title {
  display: block;
  color: #fff;
}
.router-link-exact-active.router-link-active{
  color: #006eff;
}
</style>